import axios from '@/libs/api.request'

export default class UserApi {
  // 根据条件获取用户信息
  static getList (params) {
    return axios.request({
      url: '/User/GetList',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 根据ID获取用户信息
  static getModel (params) {
    return axios.request({
      url: '/User/GetModel',
      method: 'get',
      enctype: 'multipart/form-data',
      params: params
    })
  }

  // 保存用户信息
  static save (params) {
    return axios.request({
      url: '/User/Save',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 启用/禁用用户信息
  static enabledList (params) {
    return axios.request({
      url: '/User/EnabledList',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 删除用户信息
  static delete (params) {
    return axios.request({
      url: '/User/Delete',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 修改密码
  static UpdatePassword (params) {
    return axios.request({
      url: '/User/UpdatePassword',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 导入
  static import (params) {
    return axios.request({
      url: '/User/Import',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 导出模板
  static exportTemplate (params) {
    return axios.request({
      url: '/User/ExportTemplate',
      method: 'get',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 下载错误数据
  static exportErrorFile (params) {
    return axios.request({
      url: '/User/ExportErrorFile',
      method: 'get',
      enctype: 'multipart/form-data',
      params: params
    })
  }

  // 创建VXCore账户
  static createAccountForVX (params) {
    return axios.request({
      url: '/User/CreateAccountForVX',
      method: 'get',
      enctype: 'multipart/form-data',
      params: params
    })
  }
}
